<template>
  <div class="home mar-t-10">
    <!-- 验证码示例 -->
  </div>
</template>

<script>
export default {
  name: 'Home',
  data() {
    return {
      input: '',
      req: {}
    };
  },
  async mounted() {
    // // loading示例
    // this.$$loading();
    // await this.sleep(2000);
    // this.$$loadingClose();

    // // alert示例 promise写法
    // this.$$alert({text: 'tips'})
    // .then((res) => {console.log(res);})
    // .catch((res) => {console.log(res);});
    // console.log(res);

    // // confirm示例
    // this.$$confirm({text: 'tips'})
    // .then((res) => {console.log(res);})
    // .catch((res) => {console.log(res);});
    this.postReaded();
  },
  methods: {
    async postReaded() {
      try {
        const res = await this.$get({
          url: '/rest/V1/directory/code'
        });
        console.log(res);
      } catch (e) {
        console.log(e.message);
        this.$$error(e.message);
      }
    }
  }
};
</script>
<style lang="less" scoped>
@import '../../assets/css/reset.less';
.home {
}
</style>
